local request_method = ngx.var.request_method

if request_method ~= "GET" then
    ngx.say('{"code":10000,"message":"请求方式不对","data":""}')
    return
end
local args = ngx.req.get_uri_args()

local uid = args.uid

if nil == uid then
    ngx.say('{"code":10000,"message":"uid不能为空","data":""}')
    return
end

local act_id = args.act_id
if nil == act_id then
    ngx.say('{"code":10000,"message":"act_id不能为空","data":""}')
    return
end

local redis_client = require "lib.redis"
local redis = redis_client:new()

local today = ngx.today()
local share_tj = "share:"..act_id..":"..today
local share_t = redis:get(share_tj)

if nil == share_t then
    share_t = 0
end
    share_t = share_t + 1
local share_tjs = redis:set(""..share_tj.."", share_t)
if nil ~= share_tjs then
    ngx.say('{"code":200,"message":"success","data":""}')
    return
end
